package com.ruoyi.common.base.chat.mapstruct;

import com.ruoyi.common.base.chat.domain.Chat;
import com.ruoyi.common.base.chat.dto.ChatEditDTO;
import com.ruoyi.common.base.chat.vo.ChatAppVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * ChatStruct
 *
 * @author gdk
 * @version 1.0.0
 * @since 2022/2/8 3:04
 */
@Mapper
public interface ChatStruct {
    ChatStruct INSTANCE = Mappers.getMapper(ChatStruct.class);

    /**
     * Chat -> ChatAppVO
     *
     * @param entity 实体类
     * @return {@link ChatAppVO}
     * @author gdk
     * @since 2022/2/8
     */
    ChatAppVO entity2AppVO(Chat entity);

    /**
     * list -> AppVOList
     *
     * @param list list
     * @return {@link List< ChatAppVO>}
     * @author gdk
     * @since 2022/2/8
     */
    List<ChatAppVO> list2AppVOList(List<Chat> list);

    /**
     * ChatEditDTO -> Chat
     *
     * @param dto dto
     * @return {@link List< Chat>}
     * @author gdk
     * @since 2022/2/8
     */
    Chat editDTO2Entity(ChatEditDTO dto);
}
